package com.aptech.action;

import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class LoginBlocker extends AbstractInterceptor{

	@Override
	public String intercept(ActionInvocation arg0) throws Exception {
		Map<String, Object> session=arg0.getInvocationContext().getSession();
		if(session.containsKey("isLogin")){
			return arg0.invoke();
		}
		return Action.LOGIN;
	}

}
